package com.lc.tgxm.conn;

import com.lc.tgxm.model.User;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

import java.io.File;

/**
 * 上传图片接口
 * Created by Lei on 2017/1/24.
 */
@HttpInlet(Conn.URL_UPIC)
public class UpicAsyPost extends BaseAsyPost<User> {
    public File file;

    public UpicAsyPost(AsyCallBack<User> asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected User successParser(JSONObject object) {
        User user = new User();
        JSONObject jsonObject = object.optJSONObject("data");
        user.username = jsonObject.optString("url");
        return user;
    }

}